<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>F.algorithms</title>
<link type="text/css" rel="stylesheet" href="../css/admin.css" />
<link type="text/css" rel="stylesheet" href="../css/item_show.css" />
<script type="text/javascript" src="../../1st.js"></script>
<script type="text/javascript" src="../../1st.highlight.js"></script>
</head>
<body id="split">
<div id="content">
	<div rel="F.param">
		<h2><span>返回值:</span>F.algorithms</h2>
					<h3>概述 : 各种算法集合</h3>
						
			<div class="desc">
				<div class="longdesc"><pre>包含二分法、检测碰撞算法、A*算法、广度优先寻路算法等</pre></div>
			</div>
						<div class="example">
			<h3>示例 : 检测碰撞</h3>
							<h5 xmlns="">CSS代码:</h5>
				<pre xmlns=""><code id="cssbox"></code></pre>
						
							<h5 xmlns="">HTML代码:</h5>
				<pre xmlns=""><code id="htmlbox"></code></pre>
									
				<h5 xmlns="">JS代码:</h5>
				<pre xmlns=""><code id="jsbox"></code></pre>
										
				<h5 xmlns="">结果:</h5>
				<pre xmlns=""><code id="resultbox"></code><code></code></pre>
					</div>
		<div style="text-align:right">
			
					
				<button onclick="window.open('../codepages/178.html');">运行代码</button>
						
		</div><br/>	
		<div>
			<h3>同类参考 :</h3>
			<div>
							<span><a href='129.html'>F.accordion</a></span>&#12288;|&#12288;							<span><a href='76.html'>F.grid</a></span>&#12288;|&#12288;							<span><a href='5.html'>F.layout</a></span>&#12288;|&#12288;							<span><a href='77.html'>F.highlight</a></span>&#12288;|&#12288;							<span><a href='78.html'>F.calendar</a></span>&#12288;|&#12288;							<span><a href='31.html'>F.player</a></span>&#12288;|&#12288;							<span><a href='79.html'>F.lyric</a></span>&#12288;|&#12288;							<span><a href='63.html'>F.maths</a></span>&#12288;|&#12288;							<span><a href='81.html'>F.cchar</a></span>						</div>
		</div>
	</div>
</div><br />

<textarea id="css" style="display:none;">#rbox{width:150px; height:150px; background-color:red; position:absolute;}
#gbox{width:100px; height:100px;background-color:green; position:absolute;}
#bbox{width:50px; height:50px;background-color:blue; position:absolute;}</textarea>
<textarea id="html" style="display:none;"><div id="rbox" style="left:0px;top:0px;"></div>
<div id="gbox" style="left:210px;top:210px;"></div>
<div id="bbox" style="left:120px;top:120px;"></div></textarea>
<textarea id="js" style="display:none;">function iscross(id1, id2){
	var o1 = getpos(id1);
	var o2 = getpos(id2);
	alert(F.iscross(o1,o2));
}
function getpos(id){
	var o = F(id).rect(1);
	return {x1:o.x, y1:o.y, x2:o.x+o.w, y2:o.y+o.h};
}
iscross("rbox", "gbox");
iscross("rbox", "bbox");


var a = F.bubble([2,3,1,8,6,7,5,4]);
alert(a);</textarea>
<textarea id="result" style="display:none;">false
true
[1,2,3,4,5,6,7,8]</textarea>


<script type="text/javascript">
var css = F('css').val();
var html = F('html').val();		
var js = F('js').val();
var result = F('result').val();
css && F('cssbox').highlight(css, "css");
html && F('htmlbox').highlight(html, "html");
js && F('jsbox').highlight(js, "js");
result && F('resultbox').highlight(result,"js");
</script>

</body>
</html>